package com.mit.common;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class ResultContext implements Serializable {

	private HashMap<String, Object> results;
	private List<String> infoMsg;
	private List<String> warningMsg;
	private List<String> errMsg;


	public ResultContext() {
		results = new HashMap<String, Object>();
	}

	public HashMap<String, Object> getResults() {
		return results;
	}
	
	public void addResult(String key, Object result) {
		results.put(key, result);

	}
	
	public Object getResult(String key){
		return results.get(key);
	}

	public void addInfoMsg(String msg) {
		if (infoMsg == null)
			infoMsg = new ArrayList<String>();
		infoMsg.add(msg);
	}

	public void addWarningMsg(String msg) {
		if (warningMsg == null)
			warningMsg = new ArrayList<String>();
		warningMsg.add(msg);
	}

	public void addErrMsg(String msg) {
		if (errMsg == null)
			errMsg = new ArrayList<String>();
		errMsg.add(msg);
	}

	public List<String> getInfoMsg() {
		return infoMsg;
	}

	public List<String> getWarningMsg() {
		return warningMsg;
	}

	public List<String> getErrMsg() {
		return errMsg;
	}

}
